package com.wlw.equipment;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@MapperScan("com.wlw.equipment.mapper")
@SpringBootApplication
public class EquipmentDemoApplication {

    public static void main(String[] args) {
        System.out.println(SpringBootVersion.getVersion());
        SpringApplication.run(EquipmentDemoApplication.class, args);
    }

    //注入RestHighLevelClient对象
    @Bean
    public RestHighLevelClient setClient() {
        return new RestHighLevelClient(RestClient.builder(HttpHost.create("http://192.168.52.128:9200")));
    }
}
